<%@page import="cn.util.Const"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>

<!DOCTYPE html>
<html lang="zh">
<head>
    <title>宠物用品管理系统</title>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" type="image/x-icon" href="<%=Const.ROOT %>assets/images/favicon.png"/>
    <link rel="stylesheet" href="<%=Const.ROOT %>assets/css/bootstrap.min.css">
    <link rel="stylesheet" href="<%=Const.ROOT %>assets/css/font-awesome.min.css">
    <link rel="stylesheet" href="<%=Const.ROOT %>assets/css/owl.carousel.min.css">
    <link rel="stylesheet" href="<%=Const.ROOT %>assets/css/animate.min.css">
    <link rel="stylesheet" href="<%=Const.ROOT %>assets/css/jquery-ui.css">
    <link rel="stylesheet" href="<%=Const.ROOT %>assets/css/slick.css">
    <link rel="stylesheet" href="<%=Const.ROOT %>assets/css/chosen.min.css">
    <link rel="stylesheet" href="<%=Const.ROOT %>assets/css/pe-icon-7-stroke.css">
    <link rel="stylesheet" href="<%=Const.ROOT %>assets/css/magnific-popup.min.css">
    <link rel="stylesheet" href="<%=Const.ROOT %>assets/css/lightbox.min.css">
    <link rel="stylesheet" href="<%=Const.ROOT %>assets/js/fancybox/source/jquery.fancybox.css">
    <link rel="stylesheet" href="<%=Const.ROOT %>assets/css/jquery.scrollbar.min.css">
    <link rel="stylesheet" href="<%=Const.ROOT %>assets/css/mobile-menu.css">
    <link rel="stylesheet" href="<%=Const.ROOT %>assets/fonts/flaticon/flaticon.css">
    <link rel="stylesheet" href="<%=Const.ROOT %>assets/css/style.css">
</head>
<body class="productsgrid-page">
<%@include file="inc/header.jsp" %>
<div class="main-content main-content-product no-sidebar">
    <div class="container">
			<div class="row">
				<div class="col-lg-12">
					<div class="breadcrumb-trail breadcrumbs">
						<ul class="trail-items breadcrumb">
							<li class="trail-item trail-begin">
								<a href="index.html">首页</a>
							</li>
							<li class="trail-item trail-end active">
								登录|注册
							</li>
						</ul>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="content-area col-lg-12 col-md-12 col-sm-12 col-xs-12">
					<div class="site-main">
						<h3 class="custom_blog_title">
							登录|注册
						</h3>
						<div class="customer_login">
							<div class="row">
								<div class="col-lg-6 col-md-6 col-sm-12">
									<div class="login-item">
										<h5 class="title-login">登录</h5>
										<form class="login" action="<%=Const.ROOT%>users?action=login" method="post">
											<p class="form-row form-row-wide">
												<label class="text">用户名</label>
												<input name="username" type="text" class="input-text">
											</p>
											<p class="form-row form-row-wide">
												<label class="text">密码</label>
												<input name="password" type="password" class="input-text">
											</p>
											<p class="lost_password">
												<span class="inline">
													<input type="checkbox" id="cb1">
													<label for="cb1" class="label-text">记住我</label>
												</span>
												
											</p>
											<p class="form-row">
												<input type="submit" class="button-submit" value="登录">
											</p>
										</form>
									</div>
								</div>
								<div class="col-lg-6 col-md-6 col-sm-12">
									<div class="login-item">
										<h5 class="title-login">注册</h5>


										<form class="register" action="<%=Const.ROOT%>users/reg" method="post">
											<p class="form-row form-row-wide">
												<label class="text">用户名</label>
												<form:errors path="users.username" cssStyle="color:#F00;"/>
												<input type="text" name="username" required pattern="\w{3,8}" class="input-text">
											</p>
											<p class="form-row form-row-wide">
												<label class="text">密码</label>
												<input type="password" name="password" id="pass1" required class="input-text">
											</p>
											<p class="form-row form-row-wide">
												<label class="text">确认密码</label>
												<input type="password" id="pass2" required class="input-text">
											</p>
											<p class="form-row form-row-wide">
												<label class="text">姓名</label>
												<input type="text" name="name" required class="input-text">
											</p>
											<p class="form-row form-row-wide">
												<label class="text">电话</label>
												<form:errors path="users.phone" cssStyle="color:#F00;"/>
												<input type="text" name="phone" required pattern="\d{11}" class="input-text">
											</p>
											<p class="form-row form-row-wide">
												<label class="text">头像</label>
												<input type="file" name="file" id="file1" required class="input-text" onchange="uploadFile1()">
												 <input type="hidden" name="pic" id="pic1" />
											</p>
											<p class="form-row form-row-wide">
												<label class="text">地址</label>
												<input type="text" name="address" required class="input-text">
											</p>
											<p class="form-row form-row-wide">
												<label class="text">生日</label>
												<input type="text" name="birthday" required class="input-text">
											</p>
											<p class="form-row form-row-wide">
												<label class="text">身份</label>
												<select name="role" required class="input-text">
														<option value="">请选择身份</option>
														<option value="0">管理员</option>
														<option value="1">用户</option>
												</select>
											</p>
											<p class="">
												<input type="submit" class="button-submit" value="注册">
											</p>
										</form>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
</div>
<%@include file="inc/footer.jsp" %>
<script src="<%=Const.ROOT %>assets/js/jquery-1.12.4.min.js"></script>
<script src="<%=Const.ROOT %>assets/js/jquery.plugin-countdown.min.js"></script>
<script src="<%=Const.ROOT %>assets/js/jquery-countdown.min.js"></script>
<script src="<%=Const.ROOT %>assets/js/bootstrap.min.js"></script>
<script src="<%=Const.ROOT %>assets/js/owl.carousel.min.js"></script>
<script src="<%=Const.ROOT %>assets/js/magnific-popup.min.js"></script>
<script src="<%=Const.ROOT %>assets/js/isotope.min.js"></script>
<script src="<%=Const.ROOT %>assets/js/jquery.scrollbar.min.js"></script>
<script src="<%=Const.ROOT %>assets/js/jquery-ui.min.js"></script>
<script src="<%=Const.ROOT %>assets/js/mobile-menu.js"></script>
<script src="<%=Const.ROOT %>assets/js/chosen.min.js"></script>
<script src="<%=Const.ROOT %>assets/js/slick.js"></script>
<script src="<%=Const.ROOT %>assets/js/jquery.elevateZoom.min.js"></script>
<script src="<%=Const.ROOT %>assets/js/jquery.actual.min.js"></script>
<script src="<%=Const.ROOT %>assets/js/fancybox/source/jquery.fancybox.js"></script>
<script src="<%=Const.ROOT %>assets/js/lightbox.min.js"></script>
<script src="<%=Const.ROOT %>assets/js/owl.thumbs.min.js"></script>
<script src="<%=Const.ROOT %>assets/js/jquery.scrollbar.min.js"></script>
<script src="<%=Const.ROOT %>assets/js/frontend-plugin.js"></script>
<script type="text/javascript" src="<%=Const.ROOT %>admin/js/ajaxfileupload.js"></script>
<script>
//ajax文件上传
function uploadFile1(){
	 if($("#file1").val()==""){
		  alert("请先选择文件!");
	  }else{
		  $.ajaxFileUpload(
	      {
	          url: '<%=Const.ROOT%>upload', //用于文件上传的服务器端请求地址
	          secureuri: false, //是否需要安全协议，一般设置为false
	          fileElementId: 'file1', //文件上传域的ID
	          success: function (data, status)  //服务器成功响应处理函数
	          {   
	        	  //如果文件上传成功，可以获取到文件名称,给pic隐藏域赋值
	        	  $("#pic1").val($(data).find("body").text());
	        	  alert("上传成功，请点击保存！");
	          },
	          error: function (data, status, e)//服务器响应失败处理函数
	          {
	              alert("上传失败!");
	          }
	      });
	  }
  return false;
}
</script>
</body>
</html>